<%@ page import="java.io.FileReader" %>
<%@ page import="java.io.BufferedReader" %>
<%@ page import="com.springapp.utils.CommonTools" %>
<%@ page import="com.springapp.utils.MongoDBUtil" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">

    <!-- 可选的Bootstrap主题文件（一般不用引入） -->
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap-theme.min.css">

    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>

    <!-- Custom styles for this template -->
    <link href="sticky-footer.css" rel="stylesheet">



    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <script type="application/javascript">
        function selCollContext(){
            $("#comment").toggle();
        }

        function startColl(ele){
            $("#jumbotron").empty();$("#jumbotron").html("加载中...");
            var url = "${pageContext.request.contextPath}/demo/startMain?time="+new Date().getTime() ;
            $.ajax({
                type: "POST",
                url: url,
                data:{"param":ele},
                dataType: 'json',
                cache: false,
                success: function(data) {
                    $("#jumbotron").html(data.desc);
                    alert(data.result);
                },
                error: function(){//调用出错执行的函数
                    alert("请求出错");//请求出错处理
                }
            });
        }


    </script>
</head>
<body>


<!-- Begin page content -->
<div class="container">
    <div class="page-header">
        <h1>EMC Symm Storage</h1>
    </div>
    <p class="lead">Storage device call interface and description </p>
    <p>symm start <a href="javascript:void(0)" onclick="startColl('symm');">in-db operation</a>. call api path “${pageContext.request.contextPath}/demo/startMain?param=symm”</p>
    <p>clar start <a href="javascript:void(0)" onclick="startColl('clar');">in-db operation</a>. call api path “${pageContext.request.contextPath}/demo/startMain?param=clar”</p>
    <p>borc start <a href="javascript:void(0)" onclick="startColl('broc');">in-db operation</a>. call api path “${pageContext.request.contextPath}/demo/startMain?param=broc”</p>
    <p>sico start <a href="javascript:void(0)" onclick="startColl('cisc');">in-db operation</a>. call api path “${pageContext.request.contextPath}/demo/startMain?param=cisc”</p>

    <div id="jumbotron" class="jumbotron"></div>

</div>

<div class="container"><hr>
    <p>
        file path : <input type="input"  data-style="slide-down"   value="<%--http://10.16.4.92:8080/filesColl/files/--%>${deployFilePath}">
    </p>
    <p>
        mongo info : ${MongoDBUtilIp}  ${MongoDBUtilPort}
    </p>


    <p style="display: none">
        coll file :  <button type="button" class="btn btn-sm btn-success" onclick="selCollContext();">查看/关闭</button>

        <%
            //此处写你的txt文件的绝对路径
            FileReader reader = new FileReader(CommonTools.deployFilePath +  CommonTools.SymmFile/*"Symm_FileList.xml"*/);
            BufferedReader bufferedReader = new BufferedReader(reader);
            StringBuffer txt = new StringBuffer();
            String temp = null;
            while((temp = bufferedReader.readLine()) != null) {
                txt.append(temp);
            }
        %>
        <div id="comment" style="display: none">
        <textarea cols="100" rows="10" class="comments" style="height:expression((this.scrollHeight>150)?'150px':(this.scrollHeight+5)+'px');overflow:auto;"><%=txt %></textarea>
        </div>
    </p>

</div>


<div class="footer">
    <div class="container">
        <p class="text-muted">version 1.0 : 创建</p>
    </div>
</div>


</body>
</html>
